" leader键设为空格键
let mapleader=' '
nmap <leader>    <nop>

" 自定义键的前缀
nmap s    <nop>
nmap ;    <nop>

" 保存 退出 复制 粘贴
nmap ;w    :w<cr>
nmap ;q    :q<cr>
nmap ;c    "+y
vmap ;c    "+y
nmap ;v    "+p
vmap ;v    "+p

nnoremap <leader>vs :vs<cr>
nnoremap <leader>sp :sp<cr>

" 多窗口间移动
nnoremap <leader>h    <c-w>h
nnoremap <leader>j    <c-w>j
nnoremap <leader>k    <c-w>k
nnoremap <leader>l    <c-w>l

" 取消高亮
nnoremap <silent> sn    :nohl<cr>

" 关闭当前buffer
nnoremap <silent> sq    :bd<cr>

" 手动定义文件类型
nnoremap sf    :set filetype=

" 移动居中
nnoremap j                          jzz
nnoremap J                          jjjjjzz
nnoremap k                          kzz
nnoremap K                          kkkkkzz
nnoremap {                          {zz
nnoremap }                          }zz
nnoremap [[                         [[zz
nnoremap ]]                         ]]zz
nnoremap G                          Gzz
nnoremap n                          nzz
nnoremap N                          Nzz
nnoremap w                          wzz
nnoremap b                          bzz
nnoremap *                          *zz
nnoremap #                          #zz
nnoremap %                          %zz
nnoremap zi                         zizz
nnoremap <c-d>                      <c-d>zz
nnoremap <c-u>                      <c-u>zz
nnoremap _                          -zz
nnoremap +                          +zz
nnoremap ``                         ``zz

" 退出插入模式
imap jk    <esc>

" 缓冲区移动键
nmap <silent> <leader>1         <Plug>AirlineSelectTab1
nmap <silent> <leader>2         <Plug>AirlineSelectTab2
nmap <silent> <leader>3         <Plug>AirlineSelectTab3
nmap <silent> <leader>4         <Plug>AirlineSelectTab4
nmap <silent> <leader>5         <Plug>AirlineSelectTab5
nmap <silent> <leader>6         <Plug>AirlineSelectTab6
nmap <silent> <leader>7         <Plug>AirlineSelectTab7
nmap <silent> <leader>8         <Plug>AirlineSelectTab8
nmap <silent> <leader>9         <Plug>AirlineSelectTab9
nmap <silent> <leader>-         <Plug>AirlineSelectPrevTab
nmap <silent> <leader>=         <Plug>AirlineSelectNextTab
